package cn.edu.ncu.housinghub.controller.appointment;

import cn.edu.ncu.housinghub.constant.ErrorCodeConstant;
import cn.edu.ncu.housinghub.entity.appointment.Appointment;
import cn.edu.ncu.housinghub.service.AppointmentService;
import cn.edu.ncu.housinghub.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/appointment")
public class AppointmentController {

    @Autowired
    private AppointmentService appointmentService;

    @PostMapping
    public Result createAppointment(@RequestBody Appointment appointment) {
        return appointmentService.createAppointment(appointment);
    }

    @GetMapping("/list/{tenantId}")
    public Result getAppointmentListByTenantId(@PathVariable Long tenantId) {
        return appointmentService.getAppointmentListByTenantId(tenantId);
    }
}